package com.ticket.sass.common.ticketserver.platform.cx30

import com.ticket.sass.common.ticketserver.configure.ConfigData
import org.springframework.util.DigestUtils

class Configurer {
    companion object {
        /**
         * 测试环境地址
         */
        const val ENDPOINT_TICKET = "http://pretsp.tsporistartech.cn/tsp-ws/services/tsp/cinema?wsdl"

        /**
         * 正式环境地址
         */
//        const val ENDPOINT_TICKET = "http://daditspws.oristarcloud.com/services/tsp/cinema?wsdl"
        const val NAMESPACE_TICKET = "http://soap.ws.tsp.oristartech.com/"

        fun generateTicketSign(config: ConfigData.CX30, params: List<String>): String {
            val info = config.appCode + config.cinemaCode + params.joinToString("") + "0" + config.secret

            return DigestUtils.md5DigestAsHex(info.lowercase().toByteArray())
        }
    }
}